home *** CD-ROM | disk | FTP | other *** search
/ Internet 1996 World Exposition / park.org.s3.amazonaws.com.7z / park.org.s3.amazonaws.com / Japan / Panasonic- / funcity / tokyo / flagirl.dcr / 00003_ling script.ls < prev    next >
Encoding:
Text File  |  2017-09-21  |  2.0 KB  |  80 lines

  1. property snum, cnum, flymode, lastlh, lastlv, flyhspeed, flystep
  2. global lingobj, girlobjlist, getlinggirlnum, trylingcount
  3.  
  4. on birth me, lh, lv, sanum
  5.   set snum to sanum
  6.   set cnum to the number of cast "ling"
  7.   set the puppet of sprite snum to 1
  8.   set the type of sprite snum to 1
  9.   set the castNum of sprite snum to cnum
  10.   set the ink of sprite snum to 36
  11.   set the foreColor of sprite snum to 255
  12.   set the backColor of sprite snum to 0
  13.   set the locH of sprite snum to lh
  14.   set the locV of sprite snum to lv
  15.   set flymode to 0
  16.   set flyhspeed to 0
  17.   set flystep to 0
  18.   return me
  19. end
  20.  
  21. on lingmove me
  22.   set lh to the mouseH
  23.   set lv to the mouseV
  24.   if lh > 158 then
  25.     set lh to 158
  26.   end if
  27.   if lh < 0 then
  28.     set lh to 0
  29.   end if
  30.   if lv < 10 then
  31.     set lv to 10
  32.   end if
  33.   if lv > 310 then
  34.     set lv to 310
  35.   end if
  36.   set lastlh to lh
  37.   set lastlv to lv
  38.   set the locH of sprite snum to lh
  39.   set the locV of sprite snum to lv
  40. end
  41.  
  42. on setlingflymode me
  43.   if flymode then
  44.     exit
  45.   end if
  46.   set flymode to 1
  47.   set flyhspeed to (the mouseH - lastlh) / 2.20000000000000018
  48.   if flyhspeed < 4 then
  49.     set flyhspeed to 4
  50.   end if
  51.   set flystep to 0
  52.   puppetSound("fall")
  53. end
  54.  
  55. on flyling me
  56.   set lh to integer(the locH of sprite snum + flyhspeed)
  57.   set lv to lastlv + integer(power(flystep - 8, 2) * 0.29999999999999999) - 20
  58.   set the locH of sprite snum to lh
  59.   set the locV of sprite snum to lv
  60.   repeat with l = 1 to count(girlobjlist)
  61.     set gsnum to the snum of getAt(girlobjlist, l)
  62.     if inside(the loc of sprite snum, rect(the locH of sprite gsnum - 20, the top of sprite gsnum, the locH of sprite gsnum + 20, the top of sprite gsnum + 30)) then
  63.       getling(getAt(girlobjlist, l))
  64.       set the locH of sprite snum to 600
  65.       set lingobj to EMPTY
  66.       set trylingcount to trylingcount + 1
  67.       exit repeat
  68.     end if
  69.   end repeat
  70.   if (lh > 500) or (lv > 330) then
  71.     set lingobj to EMPTY
  72.     set trylingcount to trylingcount + 1
  73.     puppetSound("ops")
  74.   end if
  75.   if trylingcount >= 12 then
  76.     showscore()
  77.   end if
  78.   set flystep to flystep + 1
  79. end
  80.